package vip.meeet.jdk.gc;

import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;
import java.util.List;

public class ManagementFactoryStart {

    public static void main(String[] args) {
        List<GarbageCollectorMXBean> garbageCollectorMXBeans = ManagementFactory.getGarbageCollectorMXBeans();
        for(GarbageCollectorMXBean bean : garbageCollectorMXBeans){
            System.out.println(bean.getName()+":"+bean.getCollectionCount()+":"+bean.getCollectionTime());
        }
    }
}
